import React from 'react';
import ReactDOM from 'react-dom/client';
import LoginPage from './pages/login/login.js';
import Home from './pages/home/home.js';
import ArticleDetails from './pages/home/article/articleDetails.js';
import { BrowserRouter, Route, Routes, Navigate } from 'react-router-dom';


const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
  <BrowserRouter>
    <Routes>
      <Route path='/' element={<LoginPage />} exact />
      <Route path='/home/*' element={<Home />} />
      <Route path='/login' element={<Navigate to={'/'} replace={true} />} exact />
      <Route path='/details/:id' element={<ArticleDetails />} />
    </Routes>
  </BrowserRouter>
);

